package cn.com.chec.en.tld;

import cn.com.chec.en.util.StringTools;
import cn.com.chec.en.util.UserRight;
import java.util.List;
import org.apache.commons.lang.StringUtils;

public class StringTld
{
  public static String substringAppend(String source, Integer end, String append)
  {
    return StringTools.substring(source, end.intValue(), append);
  }

  public static String substring(String source, Integer end)
  {
    return StringTools.substring(source, end.intValue());
  }

  public static String encoder(String source)
  {
    return StringTools.encoder(source);
  }

  public static String decoder(String source)
  {
    return StringTools.decoder(source);
  }

  public static boolean isContainsInList(String source, List<String> list)
  {
    if ((StringUtils.isBlank(source)) || (list == null) || (list.size() == 0)) {
      return false;
    }
    return list.contains(source);
  }

  public static boolean isCanOprBusiness(List<String> rights, String oprFlag)
  {
    return UserRight.isCanOprBusiness(rights, oprFlag);
  }

  public static boolean isCanOprNews(List<String> rights, String oprFlag)
  {
    return UserRight.isCanOprNews(rights, oprFlag);
  }
}